package ProjektTest;

import java.awt.Color;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;

import javax.xml.bind.JAXBException;

import org.junit.Test;

import Projekt.OrganizerEventXML;
import Tydzien10.OrganizerEvent;

public class OrganizerEventXMLTest {

	@Test
	public void test() throws JAXBException, IOException {
		ArrayList<OrganizerEvent> events = new ArrayList<OrganizerEvent>();
		events.add(new OrganizerEvent(Calendar.getInstance(), Calendar.getInstance(), "aaa", Color.BLACK));
		events.add(new OrganizerEvent(Calendar.getInstance(), Calendar.getInstance(), "bbb", Color.BLUE));
		OrganizerEventXML.exportToXML(new File("aaa.xml"), events);
		events = OrganizerEventXML.importFromXML(new File("aaa.xml"));
		for(OrganizerEvent event : events)
		{
			System.out.println(event);
		}
	}

}
